package org.example.exp2.common;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;

/**
 * @wml 26396
 */
@Getter
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CommonResponse<T> {

    private int status;
    private String message;
    private LinkableData<T> data;

    public CommonResponse(int status) {
        this.status = status;
        this.data = new LinkableData<>(null);
    }

    public CommonResponse(int status, String message) {
        this.status = status;
        this.message = message;
        this.data = new LinkableData<>(null);
    }

    public CommonResponse(int status, String message, T data) {
        this.status = status;
        this.message = message;
        this.data = new LinkableData<>(data);
    }

    public CommonResponse(int status, T data) {
        this.status = status;
        this.data = new LinkableData<>(data);
    }

    // 添加方法来获取和设置 data
    public LinkableData<T> getData() {
        return data;
    }

    public void setData(LinkableData<T> data) {
        this.data = data;
    }
}